<?php
	class relations
	{
		function __construct()
		{
			Global $follow_table, $lib;
		
			$this->setField("action");
			$this->setField("id");
			
			$this->lib = $lib;
			if(!is_object($follow_table))
			{
				require_once(SITE_PATH_LIB . "follow_table.class.php");
				$this->Follow = new follow_table;
			}
			else
			{
				$this->Users = $users;
			}	
		}
		public function runClass()
		{
			$this->Follow->changeRelation($this->User[login][id], $this->id, $this->action);
		}
		public function setUserInfo($data)
		{
			$this->User = $data;
		}
		private function setField($field, $value = FALSE) 
		{ 
			// Manuall Set Value 
			if (FALSE != $value) 
			{ 
				$this->$field = $value; 
			} 
			// Form Data First 
			elseif (FALSE != $_POST["form"][$field]) 
			{ 
				$this->$field = $_POST["form"][$field]; 
			} 
			// General Post data next 
			elseif (FALSE != $_POST[$field]) 
			{ 
				$this->$field = $_POST[$field]; 
			} 
			// Get Data last 
			elseif (FALSE != $_GET[$field]) 
			{ 
				$this->$field = $_GET[$field]; 
			} 
			// But it can't be an array 
			if (FALSE != is_array($this->$field)) 
			{ 
				unset($this->$field); 
			} 
		}
	}
	
?>